var { initObj, formatObj } = require('../libs/common');

var init = function (data) {
    return initObj(mod, data);
}

var format = function (data) {
    return formatObj(mod, data);
}

// 微信token记录表
var mod = {
    name:{
        name:'name',
        type: 'string',
        default:'redspider',
        length: 50
    },
    cache_duration: {
        name: 'cache_duration',
        type: 'date'
    },
    access_token: {
        name: 'access_token',
        type: 'string',
        length: 250
    },
    realauth_tmpid: {
        name: '身份认证模板消息id',
        type: 'string',
        length: 250
    },
    recomreview_tmpid: {
        name: '推荐人申请模板消息id',
        type: 'string',
        length: 250
    },
    apppro_tmpid: {
        name: '匹配进度模板消息id',
        type: 'string',
        length: 250
    },
    daeay_tmpid: {
        name: '每日推荐模板消息id',
        type: 'string',
        length: 250
    },
    user_confirm: {
        name: '新用户确认模板消息id',
        type: 'string',
        length: 250
    },
    createtime: {
        name: '创建时间',
        type: 'date',
        default: new Date()
    },
    updatetime: {
        name: '更新时间',
        type: 'date',
        default: new Date()
    }
};

module.exports = {
    init,
    format
};